﻿
namespace Falafel.Services.Web.Models
{
    using System;
    using System.ComponentModel.DataAnnotations;


    // The MetadataTypeAttribute identifies OrderMetadata as the class
    // that carries additional metadata for the Order class.
    [MetadataTypeAttribute(typeof(OrderMetadata))]
	[CustomValidation(typeof(OrderRules), "CaliforniaOrderLimit")]
    public partial class Order
    {

        // This class allows you to attach custom attributes to properties
        // of the Order class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class OrderMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private OrderMetadata()
            {
            }

            public int CreatedBy { get; set; }

            public int ID { get; set; }

            public int ModifiedBy { get; set; }

            public State State { get; set; }

			[Range(1, int.MaxValue, ErrorMessage="State is Required.")]
            public int StateID { get; set; }

			public DateTime OrderDate { get; set; }

			[DataType(DataType.Currency)]
			[CustomValidation(typeof(OrderRules), "MinimumOrderAmount")]
            public decimal Total { get; set; }
        }
    }


	// The MetadataTypeAttribute identifies LoginMetadata as the class
	// that carries additional metadata for the Login class.
	[MetadataTypeAttribute(typeof(LoginMetadata))]
	public partial class Login
	{

		// This class allows you to attach custom attributes to properties
		// of the Login class.
		//
		// For example, the following marks the Xyz property as a
		// required property and specifies the format for valid values:
		//    [Required]
		//    [RegularExpression("[A-Z][A-Za-z0-9]*")]
		//    [StringLength(32)]
		//    public string Xyz { get; set; }
		internal sealed class LoginMetadata
		{

			// Metadata classes are not meant to be instantiated.
			private LoginMetadata()
			{
			}

			public Guid ApplicationId { get; set; }

			public bool IsAnonymous { get; set; }

			public DateTime LastActivityDate { get; set; }

			public string LoweredUserName { get; set; }

			public string MobileAlias { get; set; }

			public Guid UserId { get; set; }

			public string UserName { get; set; }
		}
	}

	// The MetadataTypeAttribute identifies FalafelUserMetadata as the class
	// that carries additional metadata for the FalafelUser class.
	[MetadataTypeAttribute(typeof(FalafelUserMetadata))]
	public partial class FalafelUser
	{

		// This class allows you to attach custom attributes to properties
		// of the FalafelUser class.
		//
		// For example, the following marks the Xyz property as a
		// required property and specifies the format for valid values:
		//    [Required]
		//    [RegularExpression("[A-Z][A-Za-z0-9]*")]
		//    [StringLength(32)]
		//    public string Xyz { get; set; }
		internal sealed partial class FalafelUserMetadata
		{

			// Metadata classes are not meant to be instantiated.
			private FalafelUserMetadata()
			{
			}

			public DateTime CreatedDate { get; set; }

			public int ID { get; set; }

			public bool IsActive { get; set; }

			public Login Login { get; set; }

			public DateTime ModifiedDate { get; set; }

			public Guid UserID { get; set; }

		}
	}
}
